import Vue from 'vue'
import App from './App.vue'

import vueRouter from 'vue-router'
Vue.use(vueRouter)
import Home from './views/Home.vue'
import classify from './views/classify.vue'
import orderForm from './views/orderForm.vue'
import My from './views/My.vue'
// 导入二级路由
import ComedyFilm from './views/children/ComedyFilm.vue'
import Cartoon from './views/children/Cartoon.vue'
import Cate from './views/children/Cate.vue'
import Flower from './views/children/Flower.vue'
// 三级路由
import Naruto from './views/children/children/Naruto.vue'
import Dragonball from './views/children/children/Dragonball.vue'
import Douluocontinent from './views/children/children/Douluocontinent.vue'
import Gobbleupthestarrysky from './views/children/children/Gobbleupthestarrysky.vue'
const routes = [ // 定义规则
    {
        path: '/',
        redirect: Home
    },
    {
        path: '/home',
        component: Home
    },
    {
        path: '/classify',
        component: classify,
        children: [ // 二级路由
            {
                path: 'comedyfilm',
                component: ComedyFilm
            },
            {
                path: 'cartoon',
                component: Cartoon,
                children: [ // 三级路由
                    {
                        path: 'naruto',
                        component: Naruto,
                    },
                    {
                        path: 'dragonball',
                        component: Dragonball,
                    },
                    {
                        path: 'douluocontinent',
                        component: Douluocontinent,
                    },
                    {
                        path: 'gobbleupthestarrysky',
                        component: Gobbleupthestarrysky,
                    },
                ]
            },
            {
                path: 'cate',
                component: Cate
            },
            {
                path: 'flower',
                component: Flower
            }
        ]
    }, {
        path: '/orderForm',
        component: orderForm
    }, {
        path: '/My',
        component: My
    },
]
const router = new vueRouter({
    routes
})

Vue.config.productionTip = false

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')